#include<bits/stdc++.h>
using namespace std;

string x;

int main() {
	cin >> x;
	int len = x.size();
	string left(x, 0, len / 2);
	int flag = 0;
	if (len % 2 == 0)
		flag = 0;
	else
		flag = 1;
	
	string right(x, len / 2 + flag, len / 2);
	
	reverse(left.begin(), left.end());
	
	if (left >= right) {
		if (len % 2 == 0)
			x.erase(len / 2, len / 2);
		else
			x.erase(len / 2 + 1, len / 2);
		cout << x + left;
	} else if (len % 2 != 0) {
		if (x[len / 2] < '9') {
			x[len / 2]++;
			string left(x, 0, len / 2);
			reverse(left.begin(), left.end());
			x.erase(len / 2 + 1, len / 2);
			cout << x + left;
		} else {
			x[len / 2] = '0';
			for (int i = len / 2 - 1; i >= 0; i--) {
				if (x[i] - '0' + 1 == 10)
					x[i] = '0';
				else {
					x[i]++;
					break;
				}
			}
			string left(x, 0, len / 2);
			reverse(left.begin(), left.end());
			x.erase(len / 2 + 1, len / 2);
			cout << x + left;
		}
	} else {
		int len1 = left.size();
		for (int j = 0; j < len1; j++) {
			if (left[j] - '0' + 1 == 10)
				left[j] = '0';
			else {
				left[j]++;
				break;
			}
		}
		reverse(left.begin(), left.end());
		x = left;
		reverse(left.begin(), left.end());
		x = x + left;
		cout << x;
	}
	return 0;
}
